<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Module: Rcurse
  
    &mdash; Documentation by YARD 0.8.7.4
  
</title>

  <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="css/docs.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '';
  framesUrl = "frames.html#!Rcurse.html";
</script>


  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="_index.html">Index (R)</a> &raquo;
    
    
    <span class="title">Rcurse</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Module: Rcurse
  
  
  
</h1>

<dl class="box">
  
  
    
  
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">lib/rcurse.rb<span class="defines">,<br />
  lib/rcurse/engine.rb,<br /> lib/rcurse/helper.rb,<br /> lib/rcurse/context.rb</span>
</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    
<p>Rcurse - super simple template engine</p>


  </div>
</div>
<div class="tags">
  

</div><h2>Defined Under Namespace</h2>
<p class="children">
  
    
  
    
      <strong class="classes">Classes:</strong> <span class='object_link'><a href="Rcurse/Context.html" title="Rcurse::Context (class)">Context</a></span>, <span class='object_link'><a href="Rcurse/Engine.html" title="Rcurse::Engine (class)">Engine</a></span>, <span class='object_link'><a href="Rcurse/Helper.html" title="Rcurse::Helper (class)">Helper</a></span>
    
  
</p>







  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#add_helper-class_method" title="add_helper (class method)">+ (Object) <strong>add_helper</strong>(helper) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Add a helper to Rcurse, called automatically when creating a helper.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#helpers-class_method" title="helpers (class method)">+ (Hash&lt;Rcurse::Helper&gt;) <strong>helpers</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Available helpers.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#render-class_method" title="render (class method)">+ (String) <strong>render</strong>(content, context = Context.new) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Render a template.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#render_file-class_method" title="render_file (class method)">+ (String) <strong>render_file</strong>(filename, out_filename, context = Context.new) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Render a template file, optionally writing output to another file.</p>
</div></span>
  
</li>

      
    </ul>
  



  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="add_helper-class_method">
  
    + (<tt>Object</tt>) <strong>add_helper</strong>(helper) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Add a helper to Rcurse, called automatically when creating a helper</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


5
6
7</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/rcurse/helper.rb', line 5</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_add_helper'>add_helper</span> <span class='id identifier rubyid_helper'>helper</span>
    <span class='ivar'>@helpers</span><span class='lbracket'>[</span><span class='id identifier rubyid_helper'>helper</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_helper'>helper</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="helpers-class_method">
  
    + (<tt>Hash&lt;<span class='object_link'><a href="Rcurse/Helper.html" title="Rcurse::Helper (class)">Rcurse::Helper</a></span>&gt;</tt>) <strong>helpers</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Available helpers</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Hash&lt;<span class='object_link'><a href="Rcurse/Helper.html" title="Rcurse::Helper (class)">Rcurse::Helper</a></span>&gt;</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Available helpers, with helper names as keys</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


12
13
14</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/rcurse/helper.rb', line 12</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_helpers'>helpers</span>
    <span class='ivar'>@helpers</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="render-class_method">
  
    + (<tt>String</tt>) <strong>render</strong>(content, context = Context.new) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Render a template</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>content</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>A String containing the Rcurse template</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>context</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Rcurse/Context.html" title="Rcurse::Context (class)">Rcurse::Context</a></span></tt>)</span>
      
      
        <em class="default">(defaults to: <tt>Context.new</tt>)</em>
      
      
        &mdash;
        <div class='inline'>
<p>a context for the template</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The rendered template</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


73
74
75
76</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/rcurse/engine.rb', line 73</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span> <span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='const'>Context</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
    <span class='comment'># proxy
</span>    <span class='const'>Rcurse</span><span class='op'>::</span><span class='const'>Engine</span><span class='period'>.</span><span class='id identifier rubyid_render'>render</span> <span class='id identifier rubyid_content'>content</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="render_file-class_method">
  
    + (<tt>String</tt>) <strong>render_file</strong>(filename, out_filename, context = Context.new) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Render a template file, optionally writing output to another file</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>filename</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>A String containing the Rcurse template</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>out_filename</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Optional, file to write output to</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>context</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Rcurse/Context.html" title="Rcurse::Context (class)">Rcurse::Context</a></span></tt>)</span>
      
      
        <em class="default">(defaults to: <tt>Context.new</tt>)</em>
      
      
        &mdash;
        <div class='inline'>
<p>a context for the template</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>The rendered template</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


79
80
81
82</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/rcurse/engine.rb', line 79</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_render_file'>render_file</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_out_filename'>out_filename</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='const'>Context</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
    <span class='comment'># proxy
</span>    <span class='const'>Rcurse</span><span class='op'>::</span><span class='const'>Engine</span><span class='period'>.</span><span class='id identifier rubyid_render_file'>render_file</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_out_filename'>out_filename</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    
  </body>
</html>